import java.util.Scanner;

public class work_4 {
    public static void main(String[] args) {
        int[] arr = {12, 14, 23, 45, 66, 68, 70, 77, 90, 91};
        int[] brr = new int[arr.length + 1];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入要插入的数字：");
        int num = sc.nextInt();
        int i = 0;
        while (i < arr.length && arr[i] < num) {
            brr[i] = arr[i];
            i++;
        }
        brr[i] = num;
        while (i < arr.length) {
            brr[i + 1] = arr[i];
            i++;
        }
        System.out.println("生成的新数组是:");
        for (i = 0; i < brr.length; i++) {
            System.out.printf(brr[i] + " ");
        }
    }
}
